Gray code sequences, as commonly known and employed in the computer arts, have the advantage of involving solely a 1-bit difference between any two consecutive numbers in a sequence. (General background information on Gray codes can be found in a very wide variety of sources, including http://en.wikipedia.org/wiki/Gray code.) This stands in stark contrast to a standard binary sequence, where more than one bit may differ between consecutive numbers. As a result, binary sequences can cause problems in circuits that are noise sensitive or that involve multiple clock domain frequencies. Because Gray codes only involve a 1-bit difference at a time in a sequence count, performance can be greatly improved in the scenarios just mentioned.
However, Gray codes conventionally have borne the requirement that the length of a sequence needs to be a power of 2 if the sequence is to be employed cyclically. This is essentially intuitive, but can be illustrated by a simple example of a count of six (as also can be appreciated from Table 1 herebelow): 0000, 0001, 0011, 0010, 0110, 0111. In other words, for a sequence length that is not a power of 2, a Gray code cannot be used cyclically without actually compromising the aforementioned distinguishing characteristic of Gray codes, wherein only a 1-bit difference is encountered at a time. Thus, needs have long been recognized in connection with providing arrangements for generating cyclic Gray code that is able to count lengths that are not a power of 2.
In response to such needs, methods have been developed for generating Gray codes for sequences that have lengths that are not a power of two, but these have been severely restricted to solely those sequences with lengths that are of an even-numbered value (or, a multiple of two). Accordingly, conventional methods have failed to address those sequences with lengths of an odd-numbered value.
To illustrate this problem in more detail, there certainly exist applications, such as asynchronous FIFO (first-in-first-out) address generation or the transfer of cyclic data across asynchronous clock domains, that demand the use of a Gray code for odd lengths. More particularly, for asynchronous FIFOs, the address field is usually Gray-coded. Thus, as an example, there may be a need to hold a 128-bit data of 11 entries. Many conventional Gray code methods only permit FIFO depths to be a power-of-2, so in those cases the closest permitted value to 11 would be 16. Other known methods permit the usage of an even number of entries, so the closest attainable value in that case would be 12.
Accordingly, in view of the foregoing, a highly compelling need has been recognized in connection with providing methods and arrangements for counting (or generating addresses over) an odd numbered sequence in Gray code.